package cn.tedu.sprig.iocxml;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserTest {
    @Test
    public void aVoid(){
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
         User user = (User) context.getBean("user");
         user.run();
    }

    @Test
    public void t(){
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        User user = (User) context.getBean(User.class);
        user.run();
    }

    @Test
    public void w(){
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        User user = (User) context.getBean("user",User.class);
        user.run();
    }

}
